<!--<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transition//EM" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
    <link rel="stylesheet" type="text/css" th:href="@{/css/background.css}">
    <title>hr信息管理模块</title>
</head>
<body>
<div id="warp">
    <div id="top_content">
        <div id="header">
            <div id="rightheader">
                <p>
                    2022/1/11
                    <br/>
                    <span th:if="${session.user!=null}" >hr信息管理功能</span>
                    <span th:if="${session.user==null}" ><a th:href="@{/login}">点我登录 </a></span>
                    <br>
                    <a th:href="@{/user/logout}">退出</a>
                    </br>
                    <a th:href="@{/user/register}">注册hr账号</a>
                </p>
            </div>
            <div id="topheader">
                <h1 id="title">
                    <a href="">main</a>

                </h1>

            </div>
            <div id="navigation">
            </div>
        </div>
        <div id="content">
            <p id="whereami">
            </p>
            <h1>歡迎<span th:if="${session.user!=null}" th:text="${session.user.username}"></span>
                <span th:if="${session.user==null}" >游客</span>
            </h1>-->
<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
    <meta name="generator" content="Hugo 0.88.1">
    <title>User Page</title>

    <!-- <link rel="canonical" href="https://getbootstrap.com/docs/5.1/examples/dashboard/">-->



    <!-- Bootstrap core CSS -->
    <link href="../assets/dist/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet">

    <style>
        .bd-placeholder-img {
            font-size: 1.125rem;
            text-anchor: middle;
            -webkit-user-select: none;
            -moz-user-select: none;
            user-select: none;
        }

        @media (min-width: 768px) {
            .bd-placeholder-img-lg {
                font-size: 3.5rem;
            }
        }
    </style>


    <!-- Custom styles for this template -->
    <link th:href="@{/css/dashboard.css}" rel="stylesheet">
</head>
<body>
<div th:insert="~{frontpage::headtop}"></div>

<div class="container-fluid">
    <div class="row">
        <div th:insert="~{frontpage::textmenu(activeUri='user/findByPage')}"></div>


        <main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
            <h2>hr信息</h2>

        <div class="table-responsive">
            <table class="table table-striped table-sm">
                <thead>
                <th scope="col">编号</th>
                <th scope="col">姓名</th>
                <th scope="col">真实姓名</th>
                <th scope="col">性别</th>
                <th scope="col">电话</th>
                <th scope="col">邮箱</th>
                <th scope="col">入职日期</th>
                <th scope="col" th:if="${session.user!=null}">操作</th>
                    <!--<td th:if="${session.user!=null}">
                        操作
                    </td>-->

                <tbody>
                <tr th:each="user,state:${users}" class="row1">
                        <td th:text="${user.id}"></td>
                        <td th:text="${user.username}"></td>
                        <td th:text="${user.realname}"></td>
                        <td th:text="${user.gender==true?'男':'女'}"></td>
                        <td th:text="${user.telephone}"></td>
                        <td th:text="${user.email}"></td>
                        <td th:text="${#dates.format(user.onboarding,'yyyy/MM/dd')}"></td>
                    <td th:if="${session.user!=null}">
                        <a href="javascript:;"  th:onclick="'deleteUser('+${user.id}+')'">删除</a>
                        <!--<a th:href="@{/user/findByPage/detail?id=}+${user.id}">更新</a>-->
                        <a th:href="@{/user/detail(id=${user.id})}">更新</a>
                    </td>
                </tr>
                  <script>
                       function deleteUser(id){
                           console.log(id)
                           if (window.confirm('确定要删除记录嘛')){
                               location.href='[[@{/user/delete?id=}]]' +id;
                           }
                       }
                   </script>
               <div style="float: right">
                <a th:href="@{/user/export}" >导出excel</a>
               </div>
            </tbody>
                <thead>

           <tr>

           </tr>
            </table>
            <div id="page1">
                <!-- 首页'/findByPage?pageNow=0' -->
                <a th:href="@{'/user/findByPage?pageNow=1&pageSize=4'}">首页</a>
                <!-- 上一页-->
                <a th:href="@{'/user/findByPage?pageNow='+${start-1}}+'&pageSize=4'"> 上一页</a>
                <a th:href="@{'/user/findByPage?pageNow='+${start+1}}+'&pageSize=4'">下一页</a>
                共:<span th:text="${total}/4">页</span>
            </div>
            <div id="footer">
                <div id="footer_bg">
                    Personnel management procedures
                </div>
            </div>
        </div>
        </main>
    </div>
</div>
</body>
</html>